home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1994 A.D. Software. All Rights Reserved
-
- // OOFTEST5
-
- // Simple stream I/O is used to interact with the user.
- // to demonstrate the date parsing
-
- #include "oofile.hpp"
-
-
- int main()
- {
- cout << "OOFILE Validation Suite - Test 5\n"
- << "Today's date is : " << dbDate::today << endl << endl
- << "Simple test to try the input routines of the dbDate type" << endl << endl
- << "Keep entering sample date strings followed by return, or just return to exit"
- << endl << endl;
-
- short year, month, day;
-
- // change the default date order
- dbDate::sDefaultDateOrder=dbDate::orderMDY;
-
- for (;;) {
- cout << "Enter a date (MDY): " << flush;
- if (dbDate::istream2ymd(cin, year, month, day)) {
- cout << " = (YMD) " << year << "/" << month << "/" << day << endl << endl;
- cin.ignore(INT_MAX, '\n');
- cin.clear();
- }
- else {
- cout << "bad date" << endl;
- break;
- }
- }
- cout << endl << "done" << endl;
- return EXIT_SUCCESS;
- }